package marathon;

import java.nio.channels.ClosedChannelException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor;

import com.google.protobuf.Message;

public class NonBlockingQueue<M extends Message> implements Queue<M> {

	//@Property
//	private Executor executor;
//	public void setExecutor(Executor executor)
//		{ this.executor = executor; }

	private Selector selector;
	private SocketChannel socketChannel;
	
	public void put(final M message) {
		try {
			socketChannel.register(selector, SelectionKey.OP_WRITE, message);
		} catch (ClosedChannelException e) {
			e.printStackTrace();
		}
	}

}
